package nl.scalasim
package actors

import nl.scalasim.actors.traits._

/**
 * Generic structure that provides storage for certain goods.
 *
 * @author Yigal Duppen
 * @since Oct 27, 2010
 */
class Warehouse(val addressBook: AddressBook, override val descriptor: ActorDescriptor, val capacity: Map[Goods, Int], val totalCapacity: Int, val maxWorkers: Int = 1)
        extends SimulationActor(descriptor)
                with StoppableActor
                with StorageActor
                with WorkplaceActor
{

  def handleAct: PartialFunction[Any, Unit] = {
    case Act => {
      advertise(addressBook.guildmaster)
      reply(Ack)
    }
  }
  callbacks :+= handleAct
}